#ifndef CURLCLASS_H
#define CURLCLASS_H
#include "common.h"

#include <curl\curl.h>
#include <fstream>
class Curl
{
	enum TransferDirection
	{
		DOWNLOAD,
		UPLOAD
	};
	enum TransferType
	{
		DATA,
		FILE,
		DIR
	};
	CURL* m_pEasyHandle;
	CURLcode m_eErrCode;
	char m_sErrorBuff[CURL_ERROR_SIZE];
	fstream m_cFile;
	static size_t defaultCallback(void *buffer, size_t size, size_t nmemb, void *userp);
public:
	Curl();
	CURLcode getErrorCode();
	string getError();
	void setUrl(string url);
	void setCallback(size_t (*callback)(void*, size_t, size_t, void*));
	bool connect();
	bool setDirection(TransferDirection dir);
	//bool setType(TransferType type);
};






#endif